<?php
//
defined('BY_JYA') or exit('error');
cfc('core')->checklogin();
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
$return['setting']=$this->plugin_setting('basic');
$return['diy']=$this->plugin_setting('diy');
if($_RQ['op']=='list'){
	$levs = pdo_getall('jy_gohome_lev',array('uniacid'=>$_SESSION['uniacid']),'','','paixu asc');
	//$worker_list=pdo_getall('jy_gohome_worker',array('uniacid'=>$_SESSION['uniacid'],'islock'=>'0','status'=>'1'));
	
	foreach($levs as &$v){
		$v['worker_list']=pdo_getall('jy_gohome_worker',array('status'=>1,'islock'=>0,'uniacid'=>$_SESSION['uniacid'],'lev'=>$v['id']),'','','id desc');
	}
	$return['levs']=$levs;
	set_html('title','上门服务');
	exi($return);
}
/*
if($_RQ['op']=='diancai'){
	$goodid=intval($_RQ['goodid']);
	$num=intval($_RQ['num']);
	$packageid=intval($_RQ['packageid']);
	$carts=$this->session('carts');
	if(!$carts){
		$carts=array();
	}
	$carts[$goodid]['num']=$num;
	if($num == 0){
		unset($carts[$goodid]);
	}
	$goodinfo=pdo_get('jy_dish_goods',array('uniacid'=>$_SESSION['uniacid'],'id'=>$goodid));
	$packageinfo=json_decode($goodinfo['package'],true);
	$package=$carts[$goodid]['package'];
	if(!empty($packageinfo)){
		foreach($packageinfo as $k=>$v){
			if($k == $packageid){
				if($_RQ['plus']){
					$package[$k] +=1;
				}else{
					$package[$k] -=1;
					if($package[$k] == 0){
						unset($packageinfo[$i]);
					}
				}
			}
		}
		$carts[$goodid]['package'] = $package;
	}
	$carts=$this->session('carts',$carts);
	exi($carts);
}
*/
?>